<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <style>
        * {
            margin: auto;
            padding: 0
        }

        #box tr td {
            color: #FFFFFF;
            font-weight: bold;
            background-color: #666;
        }

        table {
            table-layout: fixed;
        }

        #table tr td {
            text-align: center;
            font-size: 12px;
            overflow: hidden;
            word-break: keep-all;
            text-overflow: ellipsi;
        }

        table tr td {
            border-bottom: #666 solid 1px;
            text-align: center;
            color: #20B2AA;
            background-color: #FFFFFF;
        }

        #xh {
            color: #FFFFFF;
        }
    </style>
</head>

<body>

    <table id="box" border='1' cellspacing='0' cellpadding='0' bordercolor='#666' width='100%' height='50' style="position:fixed;background-color:#003C9D;">
        <tr>
            <td width='1%'></td>
            <td width='49%'>内容</td>
            <td width='25%'>创建时间</td>
            <td width='25%'>提醒时间</td>
        </tr>
    </table>
    <div id="div1" style="width:100%;position:absolute;top:50px;text-align:center;">

    </div>
    <script type="text/javascript" src="../script/zepto.min.js"></script>

    <script type="text/javascript" src="../script/api.js"></script>
    <script>
        //时间转换
        Date.prototype.format = function(format) {
            var date = {
                "MM+": this.getMonth() + 1,
                "dd+": this.getDate(),
                "hh+": this.getHours(),
                "mm+": this.getMinutes(),
                "ss+": this.getSeconds(),
                "q+": Math.floor((this.getMonth() + 3) / 3),
                "S+": this.getMilliseconds()
            };
            if (/(y+)/i.test(format)) {
                format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
            }
            for (var k in date) {
                if (new RegExp("(" + k + ")").test(format)) {
                    format = format.replace(RegExp.$1, RegExp.$1.length == 1 ?
                        date[k] : ("00" + date[k]).substr(("" + date[k]).length));
                }
            }
            return format;
        };




        function aaa(o) {
            var id = $(o).find('td').eq(0).text();

            api.openWin({
                name: 'inf_win',
                url: './inf_win.html',
                pageParam: {
                    id: id
                }
            });

        };
    </script>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/properties.js"></script>
<script type="text/javascript">
    apiready = function() {
        api.parseTapmode();
        var user = eval("(" + localStorage.getItem("user") + ")");
        var id = user.id;
        $.ajax({
            url: URL + "edit/getAllMemo",
            type: "post",
            dataType: "json",
            data: {
                "id": id
            },
            success: function(data) {
                var result = eval("(" + data + ")");
                if (result.memos != null) {
                    var tab = "<table border='0'id='table' table-layout:fixed; cellspacing='0' cellpadding='0' bordercolor='#AAAAAA' width='100%' height='100%'>";
                    //循环行
                    for (var i = 0; i < result.memos.length; i++) {
                        var date = new Date(Date.parse(result.memos[i].date)).format("yyyy/MM/dd hh:mm:ss");
                        if (result.memos[i].remind != null) {
                            var remind = new Date(Date.parse(result.memos[i].remind)).format("yyyy/MM/dd hh:mm:ss");
                        } else {
                            remind = "";
                        }
                        tab += "<tr height='100' onclick='aaa(this)'>";
                        tab += "<td width='1%' id='xh'>" + result.memos[i].id + "</td>";
                        tab += "<td width='49%'>" + result.memos[i].msg + "</td>";
                        tab += "<td width='25%'>" + date + "</td>";
                        tab += "<td width='25%'>" + remind + "</td>";
                        tab += "</tr>";
                    }
                    tab += "</table>"
                    div1.innerHTML = tab;
                } else {
                    div1.innerText = "没有相关记录";
                }
            },
            error: function() {
                alert("error");
            }
        });


    };
</script>

</html>
